<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //检验用户名
        let reg = /\w{4,16}/;
        alert(reg.text("abc"));
        alert(reg.text("abcddd"));
        alert(reg.test("123abc"));

        //需求二：检验手机号
        let regphone = /^1[3-9]\d{9}$/;
        alert(regphone.test("110110"));
    </script>
</body>
</html>